/**
 * Created by dev-001 on 2017/2/28.
 * 用户
 */
import mongoose from 'mongoose';
const Schema = mongoose.Schema;
const ObjectId = Schema.Types.ObjectId;

/**
 * 系统用户
 */
const UserSchema = new Schema({
    name: String,
    phone: String, //电话
    avatar: String, //头像
    idCard: String, //id编号
    status: Number, //状态
    pwd: String, //密码
    createdAt: Date, 
    updatedAt: Date
});

UserSchema.pre('save', function (next) {
    this.createdAt = new Date();
    next();
});

export default mongoose.model('User', UserSchema);